<!--添加足迹-->
<form name="myform" id="myform" method="post" action="forum_mapaddsave.php?action=add">
<div class="sharebox">
    <table class="generic_table">
        <tbody>
        <tr class="gotr" height="30">
            <td>
                <b class="ll">省份：</b>
                <input type="text" class="fp_input" value="" name="map_prov" id="map_prov"> 如：山东省
            </td>
        </tr>
        <tr class="gotr" height="30">
            <td>
                <b class="ll">市区：</b>
                <input type="text" class="fp_input" value="" name="map_city" id="map_city"> 如：烟台市
            </td>
        </tr>
        <tr class="gotr" height="30">
            <td>
                <b class="ll">足迹：</b>
                <input type="text" class="fp_input" value="" name="map_area" id="map_area"> 如：蓬莱
            </td>
        </tr>
        <tr class="gotr" height="30">
            <td>
                <b class="ll">里程：</b>
                <input type="text" class="fp_input" value="" name="map_km" id="map_km" onblur="this.value=this.value.replace(/\D/g,'')" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')">千米
            </td>
        </tr>
        <tr class="gotr" height="30">
            <td>
                <b class="ll">景点：</b>
                <input type="text" class="fp_input" value="" name="map_jingdian" id="map_jingdian" onblur="this.value=this.value.replace(/\D/g,'')" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')">处
            </td>
        </tr>
        <tr class="gotr" height="30">
            <td>
                <b>踏足时间：</b>
                <select class="bTime bTime_y" name="mar_year">
					<?php
							for($i = date('Y'); $i>=1990; $i--){
								echo "<option value=\"".$i."\">".$i."</option>";
							}
					?>
                </select> 年
                <select class="bTime bTime_m" name="mar_month">
					<?php
							for($i=12; $i>=1; $i--){
								echo "<option value=\"".$i."\">".$i."</option>";
							}
					?>
                </select> 月
            </td>
        </tr>
        <tr class="gotr">
            <td>
                <b>一句话故事：</b>（可选）
                <br>
                <textarea class="fp-story" name="map_text"></textarea>
            </td>
        </tr>
        <tr height="40">
            <td class="act">
				<input type="submit" class="blow-btn mr30 confirm" value="确认">
                <a href="javascript:void(0);" class="gray-btn cancel">取消</a>
            </td>
        </tr>
        </tbody>
    </table>
</div>
</form>
<script type="text/javascript">
$(document).ready(function(){
    $('.cancel').on('click', function(){
        layer.closeAll();
    });
	
	$("#myform").submit(function(){
		var map_prov = $("#map_prov").val();
		var map_city = $("#map_city").val();
		var map_area = $("#map_area").val();
		var map_km = $("#map_km").val();
		var map_jingdian = $("#map_jingdian").val();

		if (map_prov.replace(/\ /g,"").length<1){
			alert("省份不能为空！");
			$("#map_prov").focus();
			return false;
		}
		if (map_city.replace(/\ /g,"").length<1){
			alert("市区不能为空！");
			$("#map_city").focus();
			return false;
		}
		if (map_area.replace(/\ /g,"").length<1){
			alert("足迹不能为空！");
			$("#map_area").focus();
			return false;
		}
		/*if (map_km.replace(/\ /g,"").length<1){
			alert("里程不能为空！");
			$("#map_km").focus();
			return false;
		}
		if(isNaN(map_km.replace(/\ /g,""))){
			alert("里程不能为空！");
			$("#map_km").focus();
			return false;
		}
		
		if (map_jingdian.replace(/\ /g,"").length<1){
			alert("景点不能为空！");
			$("#map_jingdian").focus();
			return false;
		}
		if(isNaN(map_jingdian.replace(/\ /g,""))){
			alert("景点不能为空！");
			$("#map_jingdian").focus();
			return false;
		}*/
	});
});
</script>



